/**
 * 
 */
package library;

/**
 * @author Gedsimon Pereira - 58554
 * @contact gspas@iscte.pt
 * 
 */
public class LengthBelow implements Filter {

	private int lengthBelow;

	/**
	 * @param lengthBelow
	 */
	public LengthBelow(int lengthBelow) {
		this.lengthBelow = lengthBelow;
	}

	@Override
	public boolean accept(String filters) {
		if (!filters.isEmpty() && filters.length() > lengthBelow) {
			return true;
		}
		return false;
	}

	/**
	 * @return the lengthBelow
	 */
	public int getLengthBelow() {
		return lengthBelow;
	}

	/**
	 * @param lengthBelow
	 *            the lengthBelow to set
	 */
	public void setLengthBelow(int lengthBelow) {
		this.lengthBelow = lengthBelow;
	}

	private int translaterStringToNumber(String value) {
		if (value.equals("UM")) {
			return 1;
		} else if (value.equals("DOIS")) {
			return 2;
		} else if (value.equals("TRES")) {
			return 3;
		} else if (value.equals("QUATRO")) {
			return 4;
		} else if (value.equals("CINCO")) {
			return 5;
		}
		return 0;
	}

}
